package com.hryk.medical.common.utils;

import android.os.Environment;

import com.baoteng.liteorm.DBConstants;

import java.io.File;

/**
 * Author: loren
 * Date: 2019/11/14
 */
public class FilePathUtils {

    /**
     * 获取全局缓存文件根目录
     *
     * @return
     */
    public static File getCommonCacheFile() {
        File file = new File(Environment.getExternalStorageDirectory(), DBConstants.DEFAULT_DB_PATH);
        if (!file.exists()) {
            file.mkdirs();
        }
        return file;
    }

    /**
     * 获取图片缓存根目录
     *
     * @return
     */
    public static File getCacheImageDir() {
        File imageFile = new File(getCommonCacheFile().getAbsolutePath() + File.separator + "Image");
        if (!imageFile.exists()) {
            imageFile.mkdirs();
        }
        return imageFile;
    }

}
